﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Microsoft.Practices.Unity;
using System.Web.Security;
using COM.Data;
using COM.Service;
using COM.Web;
using SampleApp.Data;
using SampleApp.Service;

namespace SampleApp.Web.Service
{
    public class LogErrorService : ILogErrorService
    {
        public void LogWebAppError(string info)
        {
            var runtime = Unity.Instance.GetService<IRuntime>();
            runtime.DbLogService.LogError(info);
            FileLogService.Instance.Log(info);
        }

        public void LogWcfError(string info)
        {
            var runtime = Unity.Instance.GetService<IRuntime>();
            runtime.DbLogService.LogError(info);
            FileLogService.Instance.Log(info);
        }

        public void LogUnityServiceInfo(string msg)
        {
            FileLogService.Instance.Log(msg);
        }


        public void LogScheduleInfo(string info)
        {
            var runtime = Unity.Instance.GetService<IRuntime>();
            runtime.DbLogService.LogError(info);
        }

        public void LogMvcError(string info)
        {
            var runtime = Unity.Instance.GetService<IRuntime>();
            runtime.DbLogService.LogError(info);
        }


        public void LogScheduleError(string info)
        {
            throw new NotImplementedException();
        }
    }
}